package com.all.jpa.model.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.Comment;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@ToString
@Entity
@Table(name = "sys_user", schema = "用户信息表")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name="user_id")
    @Comment("用户ID")
    private Long userId;

    @Column(name = "dept_id")
    @Comment("部门ID")
    private Long deptId;

    @Column(name = "user_name")
    @Comment("用户账号")
    private String userName;

    @Column(name = "nick_name")
    @Comment("用户昵称")
    private String nickName;

    @Column(name = "user_type")
    @Comment("用户类型（sys_user系统用户）")
    private String userType;

    @Column(name = "email")
    @Comment("用户邮箱")
    private String email;

    @Column(name = "phonenumber")
    @Comment("手机号码")
    private String phonenumber;

    @Column(name = "sex")
    @Comment("用户性别（0男 1女 2未知）")
    private String sex;

    @Column(name = "avatar")
    @Comment("头像地址")
    private String avatar;

    @Column(name = "password")
    @Comment("密码")
    private String password;

    @Column(name = "status")
    @Comment("帐号状态（0正常 1停用）")
    private String status;

    @Column(name = "del_flag")
    @Comment("删除标志（0代表存在 2代表删除）")
    private String delFlag;

    @Column(name = "login_ip")
    @Comment("最后登录IP")
    private String loginIp;

    @Column(name = "login_date")
    @Comment("最后登录时间")
    private LocalDateTime loginDate;

    @Column(name = "create_by")
    @Comment("创建者")
    private String createBy;

    @Column(name = "create_time")
    @Comment("创建时间")
    private LocalDateTime createTime;

    @Column(name = "update_by")
    @Comment("更新者")
    private String updateBy;

    @Column(name = "update_time")
    @Comment("更新时间")
    private LocalDateTime updateTime;

    @Column(name = "remark")
    @Comment("备注")
    private String remark;

}
